package hbase.template;

import org.apache.hadoop.hbase.client.Mutation;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.client.Table;

import java.util.Date;
import java.util.List;

public interface HBaseOperations {

	<T> T execute(String tableName, TableCallback<T> callback);

	Table getTable(String tableName);

	<T> List<T> find(String tableName, Scan scan, RowMapper<T> mapper);

	<T> T get(String tableName, byte[] rowKey, RowMapper<T> mapper);

	<T> T get(String tableName, byte[] rowKey, String familyName, RowMapper<T> mapper);

	<T> void put(String tableName, T record, RowSerializer<T> serializer);

	<T> void batchInsert(String tableName, List<T> records, RowSerializer<T> serializer);

	long rowCount(String tableName, Scan scan);

	void delete(String tableName, byte[] rowKey);

	void delete(String tableName, byte[] rowKey, String familyName);

	void delete(String tableName, byte[] rowKey, String familyName, String qualifier);

	void batch(String tableName, long bufferSize, List<? extends Mutation> mutations);
}